package cn.dong.order.feign;

import cn.dong.api.domain.CommonResult;
import cn.dong.base.dto.CourseDto;
import cn.dong.order.feign.fillback.CourseServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Service
@FeignClient(value = "service-edu8000", fallback = CourseServiceImpl.class)
public interface CourseService {

    /**
     * 根据课程id，查询课程信息，返回Dto对象，用于订单服务获取信息
     * @return
     */
    @GetMapping("/api/edu/course/inner/get-course-dto/{id}")
    CourseDto getCourseDto(@PathVariable("id") String id) ;

    /**
     * 更改订单销量
     * @param id
     */
    @GetMapping("/api/edu/course/update-buy-count/{id}")
    CommonResult updateBuyCount(@PathVariable("id") String id);
}
